Guild icon
S3Drive
Community / support / Respect MIME Type when previewing files
Avatar
All of the images that I have uploaded to my bucket don't include an extension, but they do have a file type associated with them. When I click on these extensionless files in S3Drive, nothing happens. It says that the preview is unavailable.
👍 1
Avatar
As you point out we rely on extension to detect the file type. MIME type information isn't available for us when we list the files, so we can't really efficiently determine the file type (and display proper file type / icon upfront). We would have to query each S3 key separately which would have horrendous performance impact. What we could do, upon clicking on the file, instead of displaying "Preview not available", we could silently fetch metadata and based on MIME type we could deduct that's indeed an image or video or something else and then open valid preview. The issue is that it still wouldn't work with encryption enabled. When we upload files we set MIME type to octet stream to not reveal the file contents. This makes this feature applicable to existing buckets with unencrypted files without extension. Can I ask what's your use case having files without extension? (edited)
Avatar
Hi @CubityFirst, sorry for reaching to you directly. We would be happy to include this feature in our roadmap, but I am trying to understand the use case behind files without extension.
Avatar
Oh sorry, I've been crazy busy. The only reason is so that when I'm linking files directly from the bucket, it doesn't show. I could have some other middleware of sorts to strip / allow stripped extensions but at the moment I just upload files with stripped extensions.
5:08 PM
It's probably a super low priority feature because in the grand scheme of things it's probably literally just me. It's just something that I noticed while browsing.
Avatar
Fair enough. I will add this to our internal queue, so we have it in mind when we do changes around file preview etc. Shouldn't be really hard to implement. Thanks for taking time to report this.
Exported 6 message(s)
Timezone: UTC+0